package com.softWang.system.controller;

import com.softWang.common.aop.annotation.SysOperationLog;
import com.softWang.common.response.ResponseResult;
import com.softWang.system.constants.SysModel;
import com.softWang.system.service.SystemUserProfileService;
import com.softWang.system.controller.vo.systemUserProfile.ChangePasswordParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Validated
@RestController
@Api(value="个人中心",tags="个人中心")
@RequestMapping("/system/userProfile")
public class SystemUserProfileController {
    @Resource
    private SystemUserProfileService userProfileService;

    @ApiOperation(value="修改密码")
    @SysOperationLog(value = "修改密码", model = SysModel.USER_MANAGE)
    @RequestMapping(value = "/changePassword",method = RequestMethod.POST)
    public ResponseResult changePassword(@RequestBody @Validated ChangePasswordParam param) throws Exception {
        userProfileService.changePassword(param);
        return ResponseResult.success();
    }

}
